<template>
  <div ref="border6" class="border-wrap">
    <svg class="dv-svg-container" :width="width" :height="height">
      <polygon
        :fill="bgColor"
        :points="`
        9, 7 ${width - 9}, 7 ${width - 9}, ${height - 7} 9, ${height - 7}
      `"
      />

      <circle :fill="borderColor[1]" cx="5" cy="5" r="2" />
      <circle :fill="borderColor[1]" :cx="width - 5" cy="5" r="2" />
      <circle :fill="borderColor[1]" :cx="width - 5" :cy="height - 5" r="2" />
      <circle :fill="borderColor[1]" cx="5" :cy="height - 5" r="2" />
      <polyline :stroke="borderColor[0]" :points="`10, 4 ${width - 10}, 4`" />
      <polyline :stroke="borderColor[0]" :points="`10, ${height - 4} ${width - 10}, ${height - 4}`" />
      <polyline :stroke="borderColor[0]" :points="`5, 70 5, ${height - 70}`" />
      <polyline :stroke="borderColor[0]" :points="`${width - 5}, 70 ${width - 5}, ${height - 70}`" />
      <polyline :stroke="borderColor[0]" :points="`3, 10, 3, 50`" />
      <polyline :stroke="borderColor[0]" :points="`7, 30 7, 80`" />
      <polyline :stroke="borderColor[0]" :points="`${width - 3}, 10 ${width - 3}, 50`" />
      <polyline :stroke="borderColor[0]" :points="`${width - 7}, 30 ${width - 7}, 80`" />
      <polyline :stroke="borderColor[0]" :points="`3, ${height - 10} 3, ${height - 50}`" />
      <polyline :stroke="borderColor[0]" :points="`7, ${height - 30} 7, ${height - 80}`" />
      <polyline :stroke="borderColor[0]" :points="`${width - 3}, ${height - 10} ${width - 3}, ${height - 50}`" />
      <polyline :stroke="borderColor[0]" :points="`${width - 7}, ${height - 30} ${width - 7}, ${height - 80}`" />
    </svg>
  </div>
</template>

<script>
export default {
  props: {
    bgColor: {
      type: String,
      default: () => 'transparent'
    },
    borderColor: {
      type: Array,
      default: () => ['red', 'rgba(0,0,255,0.8)']
    },
    width: {
      type: Number,
      default: () => 0
    },
    height: {
      type: Number,
      default: () => 0
    }
  }
}
</script>

<style scoped="scoped" lang="less">
  .dv-border-svg-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0px;
    left: 0px;

    polyline {
      fill: none;
    }
  }
 .dv-reverse {
    transform: rotate(180deg);
  }

 .sw1 {
   stroke-width: 1;
 }

 .sw3 {
   stroke-width: 3px;
   stroke-linecap: round;
 }

 .dv-bb4-line-1 {
    stroke-width: 1;
 }

 .dv-bb4-line-2 {
    stroke-width: 1;
 }

 .dv-bb4-line-3 {
   stroke-width: 3px;
   stroke-linecap: round;
 }

 .dv-bb4-line-4 {
   stroke-width: 3px;
   stroke-linecap: round;
 }

 .dv-bb4-line-5 {
    stroke-width: 1;
 }

 .dv-bb4-line-6 {
    stroke-width: 1;
 }

 .dv-bb4-line-7 {
    stroke-width: 1;
 }

 .dv-bb4-line-8 {
   stroke-width: 3px;
   stroke-linecap: round;
 }

 .dv-bb4-line-9 {
   stroke-width: 3px;
   stroke-linecap: round;
   stroke-dasharray: 100 250;
 }

 .dv-bb4-line-10 {
    stroke-width: 1;
   stroke-dasharray: 80 270;
 }
</style>
